package com.jeesite.modules.ajz.entity;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.common.utils.excel.annotation.ExcelField;
import com.jeesite.common.utils.excel.annotation.ExcelField.Align;
import com.jeesite.common.utils.excel.annotation.ExcelFields;
import com.jeesite.common.utils.excel.fieldtype.OfficeType;
import com.jeesite.modules.sys.entity.Office;
import javax.validation.Valid;

/**
 * 企业安全生产Entity的VO类
 * @author zzf
 * @version 2019-01-15
 */
@Table(name="ajz_company_info", alias="a", columns={
        @Column(name="id", attrName="id", label="id", isPK=true),
        @Column(name="enterprise_name", attrName="enterpriseName", label="营业执照名", queryType=QueryType.LIKE),
        @Column(name="enterprise_num", attrName="enterpriseNum", label="营业执照号码"),
        @Column(name="addr", attrName="addr", label="地址"),
        @Column(name="emp_count", attrName="empCount", label="员工数量"),
        @Column(name="legal_person", attrName="legalPerson", label="法人"),
        @Column(name="contact_person", attrName="contactPerson", label="联系人"),
        @Column(name="contact_person_tel", attrName="contactPersonTel", label="联系人电话"),
        @Column(name="scale", attrName="scale", label="规模", comment="规模：规上、规下"),
        @Column(name="legal_person_tel", attrName="legalPersonTel", label="法人电话"),
        @Column(name="post", attrName="post", label="职务"),
        @Column(name="enterprise_picture", attrName="enterprisePicture", label="营业执照照片"),
        @Column(name="enterprise_type", attrName="enterpriseType", label="企业性质"),
        @Column(name="registered", attrName="registered", label="注册地"),
        @Column(name="area", attrName="area", label="面积"),
        @Column(name="year_value", attrName="yearValue", label="年产值"),
        @Column(name="floor_count", attrName="floorCount", label="楼层高度"),
        @Column(name="danger_lev", attrName="dangerLev", label="隐患等级"),
        @Column(name="buiness_content", attrName="buinessContent", label="经营范围"),
        @Column(name="longitude", attrName="longitude", label="经度"),
        @Column(name="dimension", attrName="dimension", label="维度"),
        @Column(name="office_code", attrName="office.officeCode", label="部门"),
        @Column(name="openid", attrName="openid", label="联系人微信"),
        @Column(name="cycle_index", attrName="cycleIndex", label="完成第几轮排查"),
        @Column(name="cycle_count", attrName="cycleCount", label="第几轮排查的第几次排查"),
        @Column(name="cycle_ajz_index", attrName="cycleAjzIndex", label="计划第几轮排查"),
        @Column(name="deadline", attrName="deadline", label="整改截止时间"),
        @Column(name="is_triad", attrName="isTriad", label="是否三合一"),
        @Column(name="is_trouble", attrName="isTrouble", label="是否包含隐患点"),
        @Column(includeEntity=DataEntity.class),
}, joinTable={
        @JoinTable(type=JoinTable.Type.LEFT_JOIN, entity=Office.class, attrName="office", alias="u22",
                on="u22.office_code = a.office_code", columns={
                @Column(name="office_code", label="机构编码", isPK=true),
                @Column(name="office_name", label="机构名称", isQuery=false),
        }),
}, orderBy="a.update_date DESC"
)
public class AjzCompanyInfoVO extends AjzCompanyInfo {

    private static final long serialVersionUID = 1L;

    public AjzCompanyInfoVO() { this(null); }
    public AjzCompanyInfoVO(String id){ super(id); }

    @Valid
    @ExcelFields({
            @ExcelField(title="营业执照名", attrName="enterpriseName", align=ExcelField.Align.CENTER, sort=10),
            @ExcelField(title="营业执照号码", attrName="enterpriseNum", align = ExcelField.Align.CENTER, sort=20),
            @ExcelField(title="法人", attrName="legalPerson", align=ExcelField.Align.CENTER, sort=30),
            @ExcelField(title="法人电话", attrName="legalPersonTel", align=ExcelField.Align.CENTER, sort=40),
            @ExcelField(title="联系人", attrName="contactPerson", align=ExcelField.Align.CENTER, sort=50),
            @ExcelField(title="联系人电话", attrName="contactPersonTel", align=ExcelField.Align.CENTER, sort=60),
            @ExcelField(title="部门", attrName="office", align=ExcelField.Align.LEFT, sort=70, fieldType=OfficeType.class),
            @ExcelField(title="地址", attrName="addr", align=ExcelField.Align.LEFT, sort=80),
            @ExcelField(title="员工数量", attrName="empCount", align=ExcelField.Align.CENTER, sort=90),
            @ExcelField(title="企业性质", attrName="enterpriseType", align=ExcelField.Align.CENTER, sort=100),
            @ExcelField(title="年产值", attrName="yearValue", align=ExcelField.Align.CENTER, sort=110),
            @ExcelField(title="面积", attrName="area", align=ExcelField.Align.CENTER, sort=120),
            @ExcelField(title="经营范围", attrName="buinessContent", align=ExcelField.Align.CENTER, sort=130),
    })
    public AjzCompanyInfoVO getAjzCompanyInfoVO(){
        return new AjzCompanyInfoVO();
    }

//    public void setAjzCompanyInfoVO(AjzCompanyInfoVO employee){
//        System.out.println("需要设置");
//    }

}
